import java.util.*;
class Main1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNextInt()) {
            int a = in.nextInt();
            int half = a / 2;
            for (int i = half; i > 0; i++){
                if (isPrime(i) && isPrime(a - i)){
                    System.out.println(a-i);
                    System.out.println(i);
                    break;
                }
            }
        }
    }

    public static boolean isPrime(int m){
        for (int i = 2; i * i <= m; i++ ){
            if (m % i == 0){
                return false;
            }
        }
        return true;
    }
}
class BinInsert {
    public int binInsert(int n, int m, int j, int i) {
        m <<= j;
        return m|n;
    }
}
class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        int count = 0;
        int mocount = 0;
        while (a != 0){
            if ((a & 1) == 1){
                count++;
                mocount = Math.max(mocount,count);
            }else{
                count = 0;
            }
            a >>= 1;
        }
        System.out.println(mocount);
    }
}
class LCA {
    public int getLCA(int a, int b) {

        // if(a == 1 || b == 1){
        //     return 1;
        // }
        while (a != b){
            if (a > b){
                a /= 2;
            }else{
                b /= 2;
            }
        }
        return a;

    }
}
public class Test {
}
